<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">素材中心</view>
		</view>	
		<view class="clear_box"></view>
		
		<view class="details_box">
			<view class="details_title">{{title}}</view>
			<view class="order_list">
				<view class="standing">
					<view class="stand">{{content}}</view>				
				</view>
			</view>
		</view>
		<view class="confirm" @click="copyText()">复制文案</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page:1,
				scrrol:false,
				info:'',
				title:'',
				content:','
			}
		},
		onLoad(e) {
			let that = this;
			that.id = e.id;
			that.loadData();
		},
		methods: {
			loadData() {
				let that = this;
				that.Net._get('auth/material_detail', {id:that.id}, res => {
					if (res.code == 200) {
						that.info = res.data;
						that.title = res.data.title;
						that.content = res.data.content;
					}
				});
			},
			copyText(){
				uni.setClipboardData({
				    data: this.content,
				    success: function () {
				        uni.showToast({
							title: '复制成功',
							icon: 'success',
				            duration: 2000
				        });
				    }
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},

		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
		onReachBottom() {
		  var that = this;
		  that.page++;
		  // that.Net._get('shop_goods', {per_page:'10',page:that.page,}, res => {
		  //   if (res.code == 200) {
		  //     //console.log(res)
		  //     if (res.data.data == '') {
		  //       uni.showToast({
		  //         title: '已经是最后一页了',
		  //         duration: 2000,
		  //         icon: 'none'
		  //       });
		  //     } else {
		  //       that.info = that.info.concat(res.data.data); //将数据拼接在一起
		  //     }
		  //   } else if (res.code == 0) {
		  //     that.Msg.Success(res.msg, res => {});
		  //   }
		  // });
		},
	}
</script>

<style>
	

	.scrrolHeader{
		background-color: #FF7701 !important;
	}
	
	.material_box{
		width: 92%;
		margin: 4% auto 0;
	}
	
	.material_box image{
		width: 100%;
	}
	
	.details_box {
		width: 92%;
		margin: 4% auto 0;
		background-color: #fff;
		padding: 5vw 4%;
		border-radius: 3vw;
	}
	
	.details_box .details_title {
		font-size: 4.2vw;
		color: #333;
		font-weight: bold;
		margin-bottom: 5vw;
	}
	
	
	.order_list {
		width: 100%;
		margin: 4% auto 0;
		background-color: #fff;
		border-radius: 3vw;
		box-sizing: border-box;
	}
	
	.order_list .order_text {
		width: 100%;
		display: flex;
		align-items: center;
	}
	
	.order_list .order_text .order_menu {
		font-size: 3.5vw;
		color: #fff;
		background-color: #FC5D20;
		height: 9vw;
		border-radius: 9vw;
		width: 20vw;
		display: flex;
		align-items: center;
		justify-content: center;
		font-weight: bold;
	}
	
	.order_list .order_text .order_menu02 {
		background-color: #FF4246;
	}
	
	.order_list .order_text .text_box {
		flex: 1;
	}
	
	.order_list .order_text .text_box .title_box {
		width: 100%;
		display: flex;
		align-items: center;
	}
	
	.order_list .order_text .text_box .title_box .title {
		font-size: 5vw;
		font-weight: bold;
		color: #333;
		margin-right: 3vw;
	}
	
	.order_list .order_text .text_box .title_box .type {
		height: 5vw;
		padding: 0 1.5vw;
		border-radius: 0.8vw;
		font-size: 3vw;
		letter-spacing: 1px;
		font-weight: bold;
		color: #fff;
		background-color: #5F6488;
		transform: skew(-15deg);
		display: flex;
		align-items: center;
	}
	
	.order_list .order_text .text_box .text {
		width: 100%;
		font-size: 3.5vw;
		color: #666666;
		margin-top: 2vw;
	}
	
	.order_list .order_text .order_img {
		width: 28vw;
		margin-left: 3vw;
	}
	
	.order_list .order_text .order_img image {
		width: 100%;
	}
	
	.order_list .rule_box {
		font-size: 3.3vw;
		font-weight: bold;
		height: 10vw;
		padding: 0 4%;
		display: flex;
		align-items: center;
		margin-top: 4%;
		border-radius: 2vw;
	}
	
	.order_list .standing {
		width: 100%;
		padding: 3vw;
		border-radius: 2vw;
		background-color: #F8F8F8;
		margin-top: 4%;
	}
	
	.order_list .standing .stand {
		color: #666;
		font-size: 3.5vw;
		margin-top: 1vw;
		line-height: 6vw;
	}
	
	.order_list .standing .stand:nth-child(1) {
		margin-top: 0;
	}
	
	
	
</style>
